package br.com.nrti.still;

import android.content.Intent;
import android.os.Bundle;
import br.com.nrti.still.eventos.Toque;
import br.com.nrti.still.service.DisparaEvento;

import com.actionbarsherlock.app.SherlockActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;

public class FPrincipal extends SherlockActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.f_principal);
		startService(new Intent(FPrincipal.this, DisparaEvento.class));
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		com.actionbarsherlock.view.MenuInflater inflater = getSupportMenuInflater();
		inflater.inflate(R.menu.m_principal,
				(com.actionbarsherlock.view.Menu) menu);
		return super.onCreateOptionsMenu(menu);
	}

	@Override
	public boolean onMenuItemSelected(int featureId, MenuItem item) {

		switch (item.getItemId()) {
		case R.id.menu_add:
			Intent intent = new Intent(this, FEventos.class);
			startActivity(intent);
			return true;
		default:
			break;
		}

		return super.onMenuItemSelected(featureId, item);
	}

}
